#include"RBiterator.h"
#include<vector>;

template<class T>
struct keyOfvAlue
{
	const T& operator()(const T& key)
	{
		return key;
	}
};

int main()
{

	const int N = 10000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand() + i);
		//cout << v.back() << endl;
	}
	//vector<int> v = { 1,2,5,4 };

	RBTree<int,bool> t;
	for (auto e : v)
	{
		//if (e == 29365)
		//{
		//	int i = 0;
		//}
		t.Insert(e);


	}
	for (auto it = t.begin(); it != t.end(); ++it)
	{
		cout << "是否为平衡二叉树:" << t.IsValidRBTRee()<<" " << "value:" << *it << endl;

	}

	cout << "总数为" << t.Size() << endl;
	return 0;
}